/*
 * @Descripttion: 
 * @version: 
 * @Author: QYFeng
 * @Date: 2021-05-15 19:12:46
 * @LastEditors: QYFeng
 * @LastEditTime: 2021-05-16 17:48:23
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 以下代码解决路由地址重复点击的报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [{
    path: '/',
    name: 'index',
    component: () => import('../views/index.vue'),
    meta: {
      tab: '1',
      title: '首页',
    }
  },
  {
    path: '/channelDy',
    name: 'channelDy',
    component: () => import('../views/channelDy.vue'),
    meta: {
      tab: '2',
      title: '电影'
    }
  },
  {
    path: '/channelDyDetail',
    name: 'channelDyDetail',
    component: () => import('../views/channelDyDetail.vue'),
    meta: {
      tab: '2',
      title: '电影详情'
    }
  },
  {
    path: '/relatedPicturesDy',
    name: 'relatedPicturesDy',
    component: () => import('../views/relatedPicturesDy.vue'),
    meta: {
      tab: '2',
      title: '相关图片'
    }
  },
  {
    path: '/channelDsj',
    name: 'channelDsj',
    component: () => import('../views/channelDsj.vue'),
    meta: {
      tab: '3',
      title: '电视剧'
    }
  },
  {
    path: '/channelDsjDetail',
    name: 'channelDsjDetail',
    component: () => import('../views/channelDsjDetail.vue'),
    meta: {
      tab: '3',
      title: '电视剧详情'
    }
  },
  {
    path: '/channelDsjOne',
    name: 'channelDsjOne',
    component: () => import('../views/channelDsjOne.vue'),
    meta: {
      tab: '3',
      title: '单集详情'
    }
  },
  {
    path: '/relatedPicturesDsj',
    name: 'relatedPicturesDsj',
    component: () => import('../views/relatedPicturesDsj.vue'),
    meta: {
      tab: '3',
      title: '相关图片'
    }
  },
  {
    path: '/channelZy',
    name: 'channelZy',
    component: () => import('../views/channelZy.vue'),
    meta: {
      tab: '4',
      title: '综艺'
    }
  },
  {
    path: '/channelZyDetail',
    name: 'channelZyDetail',
    component: () => import('../views/channelZyDetail.vue'),
    meta: {
      tab: '4',
      title: '综艺详情'
    }
  },
  {
    path: '/relatedPicturesZy',
    name: 'relatedPicturesZy',
    component: () => import('../views/relatedPicturesZy.vue'),
    meta: {
      tab: '4',
      title: '相关图片'
    }
  },
  {
    path: '/channelZyOne',
    name: 'channelZyOne',
    component: () => import('../views/channelZyOne.vue'),
    meta: {
      tab: '4',
      title: '单集详情'
    }
  },
  {
    path: '/channelDm',
    name: 'channelDm',
    component: () => import('../views/channelDm.vue'),
    meta: {
      tab: '5',
      title: '动漫'
    }
  },
  {
    path: '/channelDmDetail',
    name: 'channelDmDetail',
    component: () => import('../views/channelDmDetail.vue'),
    meta: {
      tab: '5',
      title: '动漫详情'
    }
  },
  {
    path: '/relatedPicturesDm',
    name: 'relatedPicturesDm',
    component: () => import('../views/relatedPicturesDm.vue'),
    meta: {
      tab: '5',
      title: '相关图片'
    }
  },
  {
    path: '/channelDp',
    name: 'channelDp',
    component: () => import('../views/channelDp.vue'),
    meta: {
      tab: '6',
      title: '短片'
    }
  },
  {
    path: '/channelDpDetail',
    name: 'channelDpDetail',
    component: () => import('../views/channelDpDetail.vue'),
    meta: {
      tab: '6',
      title: '短片详情'
    }
  },
  {
    path: '/relatedPicturesDp',
    name: 'relatedPicturesDp',
    component: () => import('../views/relatedPicturesDp.vue'),
    meta: {
      tab: '6',
      title: '相关图片'
    }
  },
  {
    path: '/channelJlp',
    name: 'channelJlp',
    component: () => import('../views/channelJlp.vue'),
    meta: {
      tab: '7',
      title: '纪录片'
    }
  },
  {
    path: '/channelJlpDetail',
    name: 'channelJlpDetail',
    component: () => import('../views/channelJlpDetail.vue'),
    meta: {
      tab: '7',
      title: '纪录片详情'
    }
  },
  {
    path: '/relatedPicturesJlp',
    name: 'relatedPicturesJlp',
    component: () => import('../views/relatedPicturesJlp.vue'),
    meta: {
      tab: '7',
      title: '相关图片'
    }
  },
  {
    path: '/starLibrary',
    name: 'starLibrary',
    component: () => import('../views/starLibrary.vue'),
    meta: {
      tab: '8',
      title: '明星库'
    }
  },
  {
    path: '/star',
    name: 'star',
    component: () => import('../views/star.vue'),
    meta: {
      tab: '8',
      title: '明星'
    }
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/news.vue'),
    meta: {
      tab: '9',
      title: '资讯'
    }
  },
  {
    path: '/newsDetail',
    name: 'newsDetail',
    component: () => import('../views/newsDetail.vue'),
    meta: {
      tab: '9',
      title: '资讯详情'
    }
  },
  {
    path: '/music',
    name: 'music',
    component: () => import('../views/music.vue'),
    meta: {
      tab: '10',
      title: '音乐'
    }
  },
  {
    path: '/singer',
    name: 'singer',
    component: () => import('../views/singer.vue'),
    meta: {
      tab: '10',
      title: '歌手'
    }
  },
  {
    path: '/album',
    name: 'album',
    component: () => import('../views/album.vue'),
    meta: {
      tab: '10',
      title: '专辑'
    }
  },
  {
    path: '/single',
    name: 'single',
    component: () => import('../views/single.vue'),
    meta: {
      tab: '10',
      title: '单曲内容'
    }
  },
  {
    path: '/contactUs',
    name: 'contactUs',
    component: () => import('../views/contactUs.vue'),
    meta: {
      tab: '11',
      title: '联系我们'
    }
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router